﻿Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports DotNetNuke
Imports DotNetNuke.Services.Search
Imports NVPortal.Modules.NVNews
Partial Class View
    Inherits System.Web.UI.Page
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try
            If Not IsPostBack Then
                Dim ctlNews As New NV_NewsController
                Dim objNews As NV_NewsInfo
                objNews = ctlNews.GetByID(Request.Item("tin"))
                Me.lbTitle.Text = objNews.Title
                Me.lbDatetime.Text = objNews.Createdate.ToShortTimeString & "," & objNews.Createdate.ToShortDateString
                Me.lbContent.Text = Server.HtmlDecode(objNews.Content)
                Me.lblSumary.text = objNews.Summary
                'Cac tin khac cung chuyen muc voi tin nay
                'Dim ctlNews As New NV_NewsController
                Dim ctlSearchItem As New SearchItemInfoCollection
                Dim objSearchItem As New SearchItemInfo
                objSearchItem.Title = objNews.Title
                objSearchItem.SearchKey = objNews.Title & " " & objNews.Summary
                objSearchItem.Description = objNews.Summary
                objSearchItem.GUID = ""
                objSearchItem.Content = objNews.Title & " " & objNews.Summary & "" & HttpUtility.HtmlDecode(objNews.Content)
                objSearchItem.ImageFileId = Null.NullInteger
            End If
        Catch ex As Exception
            'Me.imgNews.Visible = False
            ' Exception
            ProcessModuleLoadException(Me, ex)
        End Try
    End Sub
End Class
